﻿@model LibMS.Models.LibDocuments
@{
    ViewBag.Title = "DocumentDetail";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="row">
    <div class="col-md-8">
        <div class="panel panel-primary">
            @if (Convert.ToBoolean(ViewData["success"]) == true)
            {
                <div class="panel-heading">
                    <h3 class="panel-title"><strong>@Model.DocumentName</strong></h3>
                </div>
                <div class="panel-body">

                    <div class="row">
                        <div class="col-lg-3 col-md-4 col-sm-3 col-xs-8">
                            <img class="img-thumbnail img-responsive" style="width: 155px; height: 190px;" src="@(!string.IsNullOrEmpty(Model.ThumbnaiPath) ? "../../Contents/Image/DocumentThumbnails/" + Model.ThumbnaiPath : "../../Contents/Image/thumbnail-none.gif")" />
                        </div>

                        <div class="col-lg-9 col-md-8 col-sm-9 col-xs-12">
                            <p><strong>Mô tả tài liệu:</strong></p>
                            <p>@Model.Descriptions</p>
                        </div>
                    </div>

                    <hr />

                    <div class="row">
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                            <dl class="dl-horizontal">
                                <dt>Tác giả</dt>
                                <dd>@Model.Author</dd>
                                <dt>Danh mục</dt>
                                <dd><a class="label label-success" href="/categories/detail/@Model.CategoryId" rel="tag">@Model.CategoryName</a></dd>
                                <dt>Vị trí (Rack)</dt>
                                <dd>@Model.RackName</dd>
                                <dt>Ký hiệu</dt>
                                <dd>@Model.KyHieu</dd>
                            </dl>
                        </div>

                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                            <dl class="dl-horizontal">
                                <dt>Số lượng</dt>
                                <dd>@Model.Total</dd>
                                <dt>Lượt xem, mượn đọc</dt>
                                <dd>@Model.ViewCount</dd>
                                <dt>Người tạo</dt>
                                <dd>@Model.CreateByName</dd>
                                <dt>Ngày tạo</dt>
                                <dd>@((Model.CreateDate.HasValue) ? Model.CreateDate.Value.ToString("MM/dd/yyyy") : "01/01/2013")</dd>
                            </dl>
                        </div>
                    </div>

                    <table class="table" id="UploadData">
                        <caption class="text-left" style="margin-bottom: 10px;"><span class="text-success"><strong>Tài liệu tải lên</strong></span></caption>
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>Tên tệp</th>
                                <th class="hidden-xs">Ngày Upload</th>
                                @if(Request.IsAuthenticated)
                                {
                                    <th>Thao tác</th>
                                }
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            }
        </div>
    </div>
    <!-- Right menu-->
    <div class="col-md-4">
        <div id="rmCategories" class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title"><strong>Danh mục tài liệu</strong></h3>
            </div>
            <div class="list-group">
            </div>
        </div>

        <div id="rmDocumentsTopView" class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title"><strong>Tài liệu đọc nhiều</strong></h3>
            </div>
            <div class="list-group">
            </div>
        </div>
    </div>
    <!-- /. Right menu-->
</div>

<!-- Modal borrow documents-->
<div class="modal fade" id="borrowDocumentModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Đăng ký mượn tài liệu</h4>
            </div>
            <div class="modal-body">
                <!-- DocumentName-->
                <div class="media">
                    <img class="pull-left img-thumbnail media-object" alt="50x54" style="width: 90px; height: 110px;" src="../../Contents/Image/thumbnail-none.gif">
                    <div class="media-body">
                        <h4 class="media-heading">tài liệu 1</h4>
                    </div>
                </div>
                <hr />
                <div class="row">
                    <div class="col-sm-6">
                        <!-- UserBorrow-->
                        <div class="form-group">
                            <label for="mUserBorrow">Người mượn</label>
                            <input type="text" class="form-control" id="mUserBorrow" placeholder="Người mượn">
                        </div>
                        <!-- KyHieu-->
                        <div class="form-group">
                            <label for="mTotal">Số lượng</label>
                            <input type="text" class="form-control" id="mTotal" placeholder="Số lượng">
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <!-- BorrowDate-->
                        <div class="form-group">                            
                            <label for="mBorrowDate">Ngày mượn</label>
                            <input type="text" class="form-control" id="mBorrowDate" placeholder="Người mượn" value="24/01/2014" disabled>
                        </div>
                        <!-- DocumentTotal-->
                        <div class="form-group">
                            <label for="mborrowDayCount">Thời gian mượn (Ngày)</label>
                            <input type="text" class="form-control" id="mborrowDayCount" placeholder="Số ngày mượn">
                        </div>
                    </div>
                </div>
                <!-- BorrowReason-->
                <div class="form-group">
                    <label for="mborrowReason">Lý do mượn</label>
                    <textarea rows="3" class="form-control" id="mborrowReason" placeholder="Lý do mượn"></textarea>
                </div>
            </div>
            <div id="myModalFooter" class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Hủy</button>
                <button type="button" class="btn btn-primary">Lưu dữ liệu</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

@section JS {
    <script src="~/Scripts/App/LibDocuments/DocumentDetail.js"></script>
    <script type="text/javascript">
        var authen = @((Request.IsAuthenticated) ? "true": "false");
        var documentDetail = new DocumentDetail(@Model.DocumentId, authen);
        documentDetail.Init();
    </script>
}
